package fr.upvm.lem3.vm3d.ui.swing.dataload;
/**
 * This thread is stoppable
 */
public class SimpleStoppableThread extends StoppableThread {
   /**
    * The Thread's run-method
    */
   public void run() {
      System.out.println("Thread started!");

      while(!this.getStop()) {
         try {
            System.out.print(".");
            Thread.sleep(100);
         } catch (Exception e) { }
      }

      System.out.println("\nThread stopped!");
   }

   public static void main(String args[]) {
      SimpleStoppableThread stoppable = new SimpleStoppableThread();
      stoppable.start();

      try {
         Thread.sleep(10000);
      } catch (InterruptedException e) { }

      stoppable.setStop(true);
   }
}
